// import { createAPI, createUpload } from './http'
import { createAPI } from './http'
// const crypto = require('crypto')

// const KEY = 'hiWcOTz^#XsppKCKRyf6n*x8*U&I1Wg1p1CLa#9V8SD@dSTD#2tWukl1WZ!QOG9l'

const rrweb = {
  save: params => createAPI('/rrweb/save', 'post', params),
  list: params => createAPI('/rrweb/list', 'get', params),
  ws: params => createAPI('/rrweb/ws', 'get', params),
}

// const menu = {
//   getList: params => createAPI('/index/getMenus', 'get', params)
// }



// const activity = {
//   getList: params => createAPI('/activity/list', 'get', params),
//   getSRCInfo: params => createAPI('/generator/list', 'get', params),
//   delete: params => createAPI('/activity/delete', 'get', params),
//   get: id =>
//     createAPI(
//       '/activity/detail',
//       'get',
//       { activity_id: id },
//       { timeout: 1000 }
//     ),
// }

// const company = {
//   getList: params => createAPI('/company/list', 'get', params),
//   getActivity: params => createAPI('/company/getActivity', 'get', params)
// }

// const source = {
//   save: params => createUpload('/source/create', params),
//   edit: params => createUpload('/source/edit', params),
//   update: params => createAPI('/source/update', 'post', params),
//   info: params => createAPI('/source/info', 'get', params),
//   md5: params => createAPI('/source/md5', 'post', params),
//   getTypeList: () =>
//     createAPI('/source/classify', 'get', { page: 1, pageSize: 99 })
// }

// const template = {
//   get: id =>
//     createAPI(
//       '/template/detail',
//       'get',
//       { template_id: id },
//       { timeout: 1000 }
//     ),
//   package: params => {
//     params.responseTime = +new Date()
//       .getTime()
//       .toString()
//       .substr(0, 10)
//     params.sign = crypto
//       .createHash('sha1')
//       .update(
//         `${params.name}${params.email}${params.responseTime}${KEY}`,
//         'utf-8'
//       )
//       .digest('hex')
//     return createAPI('/template/package', 'post', params)
//   }
// }



// const statistics = {
//   overview: id =>
//     createAPI('/statistics/report/visit/overview', 'post', { comId: id }),
//   report: params => createAPI('/statistics/report/visit/list', 'post', params),
//   version: id =>
//     createAPI('/statistics/site/version/find', 'post', { comId: id }),
//   log: params => createAPI('/statistics/site/log', 'post', params),
//   heatmap: {
//     list: params =>
//       createAPI('/statistics/report/heatmap/list', 'post', params),
//     open: params => createAPI('/statistics/report/heatmap/open', 'post', params)
//   },
//   abtest: {
//     list: params => createAPI('/statistics/abtest/list', 'get', params)
//   },
//   test: {
//     list: params => createAPI('/statistics/site/test/list', 'post', params),
//     add: params => createAPI('/statistics/site/test/add', 'post', params),
//     edit: params => createAPI('/statistics/site/test/edit', 'post', params),
//     stop: params => createAPI('/statistics/site/test/stop', 'post', params),
//     info: params => createAPI('/statistics/site/test/info', 'post', params),
//     editVersion: params =>
//       createAPI('/statistics/site/test/version/edit', 'post', params),
//     detail: params =>
//       createAPI('/statistics/report/test/version/list', 'post', params)
//   },
//   column: {
//     save: params => createAPI('/user/statistics/col/rule', 'post', params),
//     get: comId => createAPI('/user/statistics/col/rule', 'get', { comId }),
//     extend: ({ api, ...params }) => createAPI(`/statistics/extend/${api}`, 'post', params)
//   },



// const common = {}

export {
  rrweb
}
